home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
-
- global proc manipMoveValues ( string $toolName ) {
-
- string $parent = (`toolPropertyWindow -q -location` + "|manipMove");
- setParent $parent;
-
- // Initialize settings
- //
- int $manipMode = `manipMoveContext -q -mode $toolName`;
- switch ($manipMode)
- {
- case 0:
- radioButtonGrp -e -sl 1 manipModeRadio1;
- $manipMode = 1;
- break;
-
- case 1:
- radioButtonGrp -e -sl 2 manipModeRadio1;
- $manipMode = 2;
- break;
-
- case 2:
- radioButtonGrp -e -sl 1 manipModeRadio2;
- $manipMode = 3;
- break;
-
- case 3 :
- radioButtonGrp -e -sl 2 manipModeRadio2;
- $manipMode = 4 ;
- break;
-
- case 4 :
- radioButtonGrp -e -sl 1 manipModeRadio3;
- $manipMode = 5 ;
- }
-
- // Object vs Local vs Global Space vs vertex Normal
- //
- radioButtonGrp -e
- -nrb 2
- -on1 ("manipMoveContext -e -mode 0 " + $toolName)
- -on2 ("manipMoveContext -e -mode 1 " + $toolName)
- manipModeRadio1 ;
-
- radioButtonGrp -e
- -nrb 2
- -on1 ("manipMoveContext -e -mode 2 " + $toolName)
- -on2 ("manipMoveContext -e -mode 3 " + $toolName)
- manipModeRadio2;
-
- radioButtonGrp -e
- -nrb 1
- -on1 ("manipMoveContext -e -mode 4 " + $toolName)
- manipModeRadio3;
-
- int $isSnapCompRelative = `manipMoveContext -q -snapComponentsRelative $toolName`;
-
- int $isSnap = `manipMoveContext -q -snap $toolName`;
- int $isRelative = `manipMoveContext -q -snapRelative $toolName`;
- float $snapVal = `manipMoveContext -q -snapValue $toolName`;
- int $isSnapFaceCenter = `manipMoveContext -q -snapLiveFaceCenter $toolName`;
- int $isSnapVertex = `manipMoveContext -q -snapLivePoint $toolName`;
-
- checkBoxGrp -e -v1 $isSnapCompRelative manipSnapCompRelative;
-
- checkBoxGrp -e -v1 $isSnap manipMoveSnapCheck;
- checkBoxGrp -e -enable $isSnap -v1 $isRelative manipMoveSnapRelative;
- floatFieldGrp -e -enable $isSnap -v1 $snapVal manipMoveSnapValue;
- checkBoxGrp -e -v1 $isSnapFaceCenter manipSnapFaceVertex;
- checkBoxGrp -e -v2 $isSnapVertex manipSnapFaceVertex;
-
- checkBoxGrp -e
- -cc1 ("manipMoveContext -e -snapComponentsRelative #1 " + $toolName)
- manipSnapCompRelative;
-
- checkBoxGrp -e
- -cc1 ("manipMoveContext -e -snap #1 " + $toolName)
- manipMoveSnapCheck;
-
- checkBoxGrp -e
- -cc1 ("manipMoveContext -e -snapRelative #1 " + $toolName)
- manipMoveSnapRelative;
-
- floatFieldGrp -e
- -cc ("manipMoveContext -e -snapValue #1" + " " + $toolName )
- manipMoveSnapValue;
-
- checkBoxGrp -e
- -cc1 ("manipMoveContext -e -snapLiveFaceCenter #1 " + $toolName)
- manipSnapFaceVertex;
-
- checkBoxGrp -e
- -cc2 ("manipMoveContext -e -snapLivePoint #1 " + $toolName)
- manipSnapFaceVertex;
-
- if ( (`radioButtonGrp -q -sl manipModeRadio1`) ||
- (`radioButtonGrp -q -sl manipModeRadio3`) ) {
- // If object/local mode ... (or along rotation axes mode)
-
- if (`checkBoxGrp -q -value1 manipMoveSnapCheck`) {
- // If Discrete Move ...
-
- // It has to be Discrete Relative. Force it ON and Disable It.
- //
- checkBoxGrp -e -value1 true manipMoveSnapRelative;
- checkBoxGrp -e -enable false manipMoveSnapRelative;
- manipMoveContext -e -snapRelative on $toolName;
- }
- } else {
- // For other modes...
- if (`checkBoxGrp -q -value1 manipMoveSnapCheck`) {
- checkBoxGrp -e -enable true manipMoveSnapRelative;
- }
- }
-
- // set the state for the interactiveUpdate flag.
- // valid only if mode is "vertex normal".
- //
- int $interactiveUpdate = `manipMoveContext -q -interactiveUpdate $toolName`;
- checkBoxGrp -e -onc ("manipMoveContext -e -iu 1 " + $toolName)
- -ofc ("manipMoveContext -e -iu 0 " + $toolName)
- -v1 $interactiveUpdate UVNtriadUpdateCheckBox;
-
- // make the UVNtriadUpdateCheckBox visible or not ?
- // visible if manipMode is vertexNormal i.e. 4
- //
- if( $manipMode == 4 ) {
- checkBoxGrp -e -vis 1 UVNtriadUpdateCheckBox ;
- } else {
- checkBoxGrp -e -vis 0 UVNtriadUpdateCheckBox ;
- }
-
- string $icon;
- string $helpTag;
- if( $manipMode != 4 ) {
- $icon = "manipMove.xpm";
- $helpTag = "MoveTool";
- } else {
- $icon = "moveNormal.xpm";
- $helpTag = "MoveNormalTool";
- }
- toolPropertySetCommon $toolName $icon $helpTag;
- toolPropertySelect "manipMove";
- }
-